package com.ctl.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ctl.dto.VideosDTO;
import com.ctl.entity.Video;
import com.ctl.service.VideoService;
import com.ctl.mapper.VideoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author stars
* @description 针对表【video(视频)】的数据库操作Service实现
* @createDate 2023-02-25 09:50:24
*/
@Service
public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video>
    implements VideoService{
    @Autowired
    private VideoMapper mapper;
    @Override
    public List<VideosDTO> getPageVideoDTO(Integer page, Integer per_page) {
        return mapper.getVideoByUp((page-1)*per_page,per_page);
    }

    @Override
    public List<VideosDTO> getByCategoryIdAll(Integer page, Integer per_page, Integer category) {
        return mapper.getByCategoryIdAll((page-1)*per_page,per_page,category);
    }
}




